package cn.template.serve_project.service.impl;

import cn.template.serve_project.entity.Permissions;
import cn.template.serve_project.mapper.PermissionsMapper;
import cn.template.serve_project.service.PermissionsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 权限(Authentication)表服务实现类
 */
@Service("permissionsService")
public class PermissionsServiceImpl extends ServiceImpl<PermissionsMapper, Permissions> implements PermissionsService {

    private PermissionsMapper permissionsMapper;

    PermissionsServiceImpl(PermissionsMapper permissionsMapper) {
        this.permissionsMapper = permissionsMapper;
    }

    /**
     * 根据角色查询权限
     *
     * @param roleId 角色id
     * @return 权限列表
     */
    @Override
    public List<Permissions> selectAllByRole(Integer roleId) {
        return permissionsMapper.selectByRole(roleId);
    }
}

